
# 运算符

# 1. 算数运算符
print(3+2)
print(3-2)
print(3*2)
print(-3/2)
print(-3//2)
print(3%2)
print(3**2)

# 2. 比较运算符
a = 6
b = 5
c = 5
print(a > b)
print(a == b)
print(a != b)

print(b == c)
print(b is c)

# 3. 赋值运算符
"""
a += b      <==> a = a + b 
a -= b      <==> a = a - b
a *= b      <==> a = a * b
a /= b      <==> a = a / b
a //=b      <==> a = a // b
a %= b      <==> a = a %b
a **=b      <== > a = a**b
"""
print("=======================")
a = 7
b = 3
print(a)
a += b
print(a)
a **= b
print(a)

# 4. 逻辑运算符
"""
逻辑与(and) : 条件1 and 条件2 ，两个条件都为真时返回真 ，否则返回假
逻辑或(or)  : 条件1 or 条件2 ，两个条件满足其一返回真 ，否则返回假
逻辑非(not) : not 条件 ，条件为真 ，加not变为假 ，反之变为真 。
"""
print("==============")
m = 10
n = 5
print(m > 8 and n >2)
print(m > 8 and n <2)

print(m > 12 or n >2)
print(m > 12 and n <2)

print(not m > 8)
print(not m > 18)

